package com.kun.rental.controller;

import com.kun.rental.entity.Order;
import com.kun.rental.service.IOrderService;
import com.kun.rental.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ikun
 * @since 2024-07-04
 */
@RestController
@RequestMapping("/rental/order")
public class OrderController {

    @Autowired
    private IOrderService orderService;

    @PostMapping("/save")
    public Result save(@RequestBody Order order) {
        return orderService.insert(order) ? Result.success() : Result.fail();
    }


}
